package pl.edu.agh.to1.dice.logic;

import java.util.Random;

public class Dices {
	private int states[];
	private boolean lock[];
	private Random rand;
	public Dices(){
		rand = new Random();
		states = new int[5];
		lock = new boolean[5];
		zeruj();
	}

	public void losuj(){
		for(int i=0;i<5;i++)
			if(states[i] == 0){
				states[i] = rand.nextInt(6)+1;
				lock[i] = false;	
			}
	}

	public void changeLock(int idk){
		lock[idk] = !lock[idk];
	}

	public boolean getLock(int idk){
		return lock[idk]; 
	}

	public void zeruj(){
		for(int i=0;i<5;i++){
			if(!lock[i])
				states[i] = 0;	
		}
	}
	
	public void kasuj(){
		for(int i=0;i<5;i++){
			states[i] = 0;
			lock[i] = false;		
		}	
	}
	public int [] getStates(){
		return states;	
	}
}
